# Process this file with autoconf to produce a configure script.

AC_INIT([Refran: A Recipe Framework],[0.1],[cgarcia@fractal-es.com],[refran])

AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_AUX_DIR([admin])

AC_CANONICAL_BUILD

AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes])

AM_MAINTAINER_MODE

AC_PREFIX_DEFAULT([/usr/local/])

# Order of arguments: VERSION, CURRENT, REVISION, AGE
REFRAN_CONFIG_VERSION([$VERSION], [0], [1], [0]) 

#Set languaje to C++ 
AC_LANG([C++])
#This has to be before AC_PROG_CXX if we want AC_PROG_CXX not to set CXXFLAGS
#to -g -O2 automatically
REFRAN_ADD_DEBUG_OPTION

# Checks for programs.
# Check C++ with C+0x dialect
AC_PROG_CXX
AC_CXX_COMPILE_STDCXX_0X
LT_INIT
LTDL_INIT
AC_PROG_INSTALL
AC_ENABLE_SHARED(yes)
AC_SUBST(LIBTOOL_DEPS)

# Checks for header files.
AC_HEADER_STDC

# Checks for log4cpp library
PKG_CHECK_MODULES([LOG4CPP], [log4cpp],  ,AC_MSG_ERROR([no log4cpp available]))

# Checks for boost libraries (the macros are found in the autoconf archive)
AX_BOOST_BASE
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_THREAD
AX_BOOST_UNIT_TEST_FRAMEWORK

# Setup Doxygen 
DX_DOXYGEN_FEATURE(ON)
DX_HTML_FEATURE(ON)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN($PACKAGE_NAME, [doxygen/Doxyfile], doc)

AC_CONFIG_FILES([Makefile
                 doxygen/Doxyfile
                 refrancore/Makefile
                 tests/Makefile
                 refran.pc])

AC_OUTPUT
